package com.itheima.springbootmybatistest.service.impl;

import com.itheima.springbootmybatistest.dao.UserDao;
import com.itheima.springbootmybatistest.domain.User;
import com.itheima.springbootmybatistest.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description:
 * @Version: V1.0
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

    @Autowired
    private RedisTemplate redisTemplate;

    //查询所有用户信息
    @Override
    public List<User> findAll() {
        //从redis中获取用户数据




        List<User>list = userDao.findAll();
        return list;








    }

    @Override
    public void add(User user) {
        userDao.add(user);
    }

    @Override
    public void deleteById(Integer id) {
        userDao.deleteById(id);
    }

    @Override
    public void update(User user) {
        userDao.update(user);
    }

    @Override
    public User findById(Integer id) {
        return userDao.findById(id);
    }
}
